1. Technical Field of the Invention
The present invention relates a method and an apparatus for scheduling tasks to control hardware devices necessary to realize desired functions in an apparatus, such as vehicles.
2. Related Art
Techniques of virtualization are well known in which an operating system (OS), an application, and the like are activated on a virtualized computer. In an application of such a technique of virtualization, a computer that controls an existing device is virtualized, and a program used for controlling the existing device is activated on the virtualized computer to thereby easily re-create the existing device.
Owing to such a technique of virtualization, a virtual machine (also referred to as a “virtual computer”), which is a program for re-creating an existing device, can be fabricated for each of a plurality of existing devices. Further, the plurality of existing devices can be united into a single device by running these virtual machines within a single system.
At the same time with the unification of a plurality of existing devices into a single device, new functions different from those of the existing devices may be added. In this case, a dedicated application for realizing each of the new functions may be newly provided, and a virtual machine and the dedicated application may be scheduled as a task, for parallel operation of the existing devices and the tasks.
Thus, when virtual machines and respective dedicated applications are scheduled as tasks, an operation time (i.e., a duration for execution) is required to be appropriately allocated to each of the tasks. For example, when a virtual machine for controlling a vehicle and a dedicated application are scheduled as a task, real-time performance of the task is required to be ensured. To this end, an operation time allocated to each task in every predetermined period is required to be guaranteed.
In this regard, a known publication JP-A-2008-234116 discloses a virtual computer controller. In the virtual computer controller, tasks and interrupt handlers of the individual virtual computers are unitarily assigned with priorities. At the occurrence of an interrupt, the priority of the task of the virtual computer in operation is compared with the priority of the interrupt handler corresponding to the interrupt that occurred, to determine whether or not the interrupt handler should be executed.
According to the virtual computer controller disclosed in the patent document mentioned above, an interrupt handler corresponding to a virtual computer having lower priority is prevented from being executed when a virtual computer having higher priority is in operation. Thus, the virtual computer of higher priority can be smoothly operated. However, even when priorities are assigned to individual tasks, allocation of an operation time to each virtual computer in every predetermined period of time cannot be guaranteed. This means that the real-time performance of each virtual computer is not necessarily ensured.